/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * Portions created by the Initial Developer are
 * Copyright (C) 2012 the Initial Developer.
 * All Rights Reserved.
 *
 * The Original Code is this.
 *
 * The Initial Developer of the Original Code is the author below.
 */ 
 /**
 * @file .h
 * @brief auto generated.
 * @author K.Ozaki
 * @date 2011/03/11
 */


/*
 * SignalAction.h
 *
 *  @date: 2011/10/31
 *  @author: ozaki
 */

#ifndef SIGNALACTION_H_
#define SIGNALACTION_H_

#include "semi/util/UtilBase.h"
//#include "semi/posix/Semaphore.h"

namespace semi {
namespace posix {

class SignalAction {
public:
    SignalAction(int signalNo);
    virtual ~SignalAction();

    //    static SignalAction* getInstance();

    sigevent create();
    int wait();
    void raiseSignal();

    //    static int getWaitCount();

    void reset();

    int sig_num;
    bool onWait;
    bool isCreated;

private:
    //    static SignalAction* instance;
    //    Semaphore sem;
    SignalAction();
    static void signalAction(int signum, siginfo_t *info, void *ctxt);

};

}
}

#endif /* SIGNALACTION_H_ */
